<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta content="yes" name="apple-mobile-web-app-capable">
          <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, target-densityDpi=device-dpi" />
          <!-- 微软的老式浏览器 -->
          <meta name="MobileOptimized" content="320">
          <!-- 启用360浏览器的极速模式(webkit) – -->
          <meta name="renderer" content="webkit">
          <!-- 避免IE使用兼容模式 -->
          <meta http-equiv="X-UA-Compatible" content="IE=edge">
          <!-- 针对手持设备优化，主要是针对一些老的不识别viewport的浏览器，比如黑莓 -->
          <meta name="HandheldFriendly" content="true">
          <!-- uc强制竖屏 -->
          <meta name="screen-orientation" content="portrait">
          <!-- QQ强制竖屏 -->
          <meta name="x5-orientation" content="portrait">
          <!-- UC强制全屏 -->
          <meta name="full-screen" content="yes">
          <!-- QQ强制全屏 -->
          <meta name="x5-fullscreen" content="true">
          <!-- UC应用模式 若开启长按无法复制链接-->
          <!--meta name="browsermode" content="application"-->
          <!-- QQ应用模式 -->
          <meta name="x5-page-mode" content="app">
          <!--网站开启对web app程序的支持-->
          <meta name="apple-touch-fullscreen" content="yes">
          <!--在web app应用下状态条（屏幕顶部条）的颜色-->
          <meta name="apple-mobile-web-app-status-bar-style" content="black">
          <!-- windows phone 点击无高光 -->
          <meta name="msapplication-tap-highlight" content="no">
          <!--移动web页面是否自动探测电话号码-->
          <!--<meta http-equiv="x-rim-auto-match" content="none">-->
          <!--手机号码显示为拨号链接-->
          <meta name="format-detection" content="telephone=no">
          <meta http-equiv="Cache-Control" content="max-age=300" />
          <meta http-equiv="Expires" content="300" />
          <title>编辑资料</title>
          <link rel="stylesheet" href="../css/reset.css">
          <link rel="stylesheet" href="../css/connect.css">
          <link rel="stylesheet" href="../assets/layer_mobile/need/layer.css">
          <script src="../assets/layer_mobile/layer.js"></script>
          <script src="../js/jquery.min.js"></script>
          <script src="../js/common.js"></script>
    </head>
    <body>
      <div class="container">
        <div class="form">
          <div class="plat">
            <select id="plat" name="plat" autofocus required size="1">
              <option class="place" value="" disabled selected hidden >请选择您投资的平台数量</option>
            </select>
          </div>
          <div class="year">
            <select id="year" name="plat" autofocus required size="1">
              <option class="place" value="" disabled selected hidden>请选择您投资网贷的年限</option>
            </select>
          </div>
          <div class="number">
            <select id="number" name="plat" autofocus required size="1">
              <option class="place" value="" disabled selected hidden>请选择您踩雷的次数</option>
            </select>
          </div>
        </div>
        <div class="short-comment" id="wordCounta">
            <textarea class="comment-textarea" cols="5" type="text" maxlength="30" placeholder="请输入您的个人简介..." ></textarea>
            <span class="wordWrap">
            <var class="wordHave">0</var> /<var class="word"> 30</var>
            </span>
        </div>
       <div class="btn">
        <p>提交</p>
      </div>
      </div>
      <script type="text/javascript">
      for(var i=0 ; i<100 ;i++){
        var opinion = '<option value ="'+i+'">已投资平台'+i+'家</option>';
        $('#plat').append(opinion);
      }
      for(var i=0 ; i<100 ;i++){
        var opinion = '<option value ="'+i+'">已投资网贷'+i+'年</option>';
        $('#year').append(opinion);
      }
      for(var i=0 ; i<100 ;i++){
        var opinion = '<option value ="'+i+'">已踩雷'+i+'次</option>';
        $('#number').append(opinion);
      }
      $('select').click(function() {
        $(this).css('color','#333333')
      });
      $('.btn').click(function(){
        var plat = $('#plat').val();
        console.log(plat);
        var year = $('#year').val();
        var number = $('#number').val();
        var commentS = $('.comment-textarea').val();
        if(!plat){
            layer.open({
              content: '请选择您投资的平台数量！'
              ,skin: 'msg'
              ,time: 2 //2秒后自动关闭
            });
        }else if(!year){
          layer.open({
              content: '请选择您投资网贷的年限！'
              ,skin: 'msg'
              ,time: 2 //2秒后自动关闭
            });
        } else if(!number){
          layer.open({
              content: '请选择您踩雷的次数！'
              ,skin: 'msg'
              ,time: 2 //2秒后自动关闭
            });
        }else if(!commentS){
          layer.open({
              content: '请输入您的个人简介！'
              ,skin: 'msg'
              ,time: 2 //2秒后自动关闭
            });
        }else{
          layer.open({
              content: '提交成功！'
              ,skin: 'msg'
              ,time: 2 //2秒后自动关闭
            });
        }
      
      })
      // 个人简介
  $(function(){
        var wordCount = $("#wordCounta"),
            textArea = wordCount.find("textarea"),
            word = wordCount.find(".word");
            wordHave = wordCount.find(".wordHave");
        statInputNum(textArea,word,wordHave);
    });
    function statInputNum(textArea,numItem,num) {
        var max = numItem.text(),
            curLength;
        textArea[0].setAttribute("maxlength", max);
        curLength = textArea.val().length;
        num.text(curLength);
        textArea.on('input propertychange', function () {
            var _value = $(this).val().replace(/\n/gi,"");
            num.text(_value.length);
        });
    }
      </script>
    </body>
</html>